package datagraph

import datagraph.bundle.{PrintAndOutput, Read}
import datagraph.core.{GraphConf, LocalEngine}
import ws.very.util.lang.Reflects

object SampleTest2 extends App {

  class MyGraphConf extends GraphConf.Basic {


    override protected val selfTypeTag = Reflects.runtimeUniverse.typeTag[this.type]

    var readCsv = new Bundle[Read] {
      lazy val bundle: Read = Read("")
    }

    var print = new Bundle[PrintAndOutput] {


      val bundle: PrintAndOutput = PrintAndOutput("t1")
      input.one(readCsv)
       //FIXME:只能内部
    }

    var print2= new Bundle[PrintAndOutput] {


      val bundle: PrintAndOutput = PrintAndOutput("t2")

      input.one(readCsv) //FIXME:只能内部
    }

    var print3= new Bundle[PrintAndOutput] {


      val bundle: PrintAndOutput = PrintAndOutput("t3")

      input.one(print) //FIXME:只能内部
    }
    var print4= new Bundle[PrintAndOutput] {


      val bundle: PrintAndOutput = PrintAndOutput("t4")

      input.one(print3) //FIXME:只能内部
    }
    var print5= new Bundle[PrintAndOutput] {


      var bundle: PrintAndOutput = PrintAndOutput("t5")

      input.one(print2) //FIXME:只能内部
    }

    //def build = new TargetGraph(this)
  }

  val g = new MyGraphConf


  val result = LocalEngine.exec(g)


  result.foreach(println)


}
